package cn.ywang.pattern.battercake.v2;

/**
 * @author BeatificWang
 * @date 2019/3/20 7:06
 */
public abstract class AbstractBattercakeDecorator extends AbstractBattercake {

	private AbstractBattercake battercake;

	public AbstractBattercakeDecorator(AbstractBattercake battercake) {
		this.battercake = battercake;
	}

	/**
	 * 扩展方法
	 */
	protected abstract void doSth();

	/**
	 * 获取名称
	 *
	 * @return
	 */
	@Override
	protected String getName() {
		return this.battercake.getName();
	}

	/**
	 * 获取价格
	 *
	 * @return
	 */
	@Override
	protected int getPrice() {
		return this.battercake.getPrice();
	}
}
